import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';

import main from "./main";
import article from "./article";
import notes from "./notes";
import fish from "./fish";
import toolList from "./toolList";
import other from "./other";

const routes: Array<RouteRecordRaw> = [
  main,
  article,
  notes,
  fish,
  toolList,
  ...other,
];

const router = createRouter({
  history: createWebHistory(),
  routes: routes,
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition;
    } else {
      return { top: 0 };
    }
  },
});
export default router;
